package com.pac.hospital.dao.impl;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.pac.hospital.bean.HospitalManagerBean;
import com.pac.hospital.dao.HospitalManagerDao;

/**
 * 医院管理员dao实现
 * 
 * @author lujun.chen
 * @version [版本号, 2015年3月29日]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@Repository(value = "hospitalManagerDao")
public class HospitalManagerDaoImpl implements HospitalManagerDao {

	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;

	@Override
	public boolean addHospitalManager(HospitalManagerBean hospitalManagerBean) {

		int n = sqlSessionTemplate.insert("addHospitalManager",
				hospitalManagerBean);
		return n > 0;
	}

	@Override
	public boolean delHospitalManager(HospitalManagerBean hospitalManagerBean) {
		int n = sqlSessionTemplate.delete("delHospitalManager",
				hospitalManagerBean);
		return n > 0;
	}

	@Override
	public List<HospitalManagerBean> queryHospitalManager(
			HospitalManagerBean hospitalManagerBean) {

		return sqlSessionTemplate.selectList("queryHospitalManager",
				hospitalManagerBean);
	}

}
